import React, { useState } from 'react'
import { useSelector, useDispatch } from 'react-redux'
const App = () => {
   const num = useSelector((store) =>store.counter.num)
   const [num1,setNum1]=useState(num)
   const fn=()=>{
     setNum1(num1=>num1+1)
   }
   const fn1=()=>{
     setNum1(num1=>num1-1)
   }
  return (
    <div>
      <button onClick={()=>fn()}>按钮+1</button><span>数量：{num1}</span>
      <button onClick={()=>fn1()}>按钮-1</button>
    </div>
  )
}

export default App
